package book;

import java.util.Arrays;

public class BookList {
    private Book[] books = new Book[10];
    private int usedSize;

    public BookList(){
        books[0] = new Book("三国演义","罗贯中", 35.5,"小说");
        books[1] = new Book("西游记","吴承恩", 45.5,"小说");
        books[2] = new Book("红楼梦","曹雪芹", 37.5,"小说");
        books[3] = new Book("水浒传","施耐庵", 40.0,"小说");
        books[4] = new Book("呐喊","鲁迅", 55.5,"小说");
        this.usedSize = 5;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public void setBooks(int pos, Book book) {
        books[pos] = book;
    }

    public Book getPos(int pos){
        return books[pos];
    }

    @Override
    public String toString() {
        return "BookList{" +
                "books=" + Arrays.toString(books) +
                '}';
    }
}
